print("test1---->")
person = { 
            "first_name" : "liu",
            "last_name" : "ming",
            "age" : "25",
            "city" : "suzhou"}

print("he is " + person["first_name"] + " " + person["last_name"] + ", " + \
        person["age"] + "old, come from " + person["city"] + ".")

print("\ntest2---->")
friends = {
            "libai" : "9",
            "hong" : "8",
            "dufu" : "7",
            "hai" : "6",
            "jin" : "2"}
for name, num in friends.items():
    print("my friend " + name + ", " + "he's lucky num is " + num + ".")

print("\ntest3---->")
coding = {
            "for" : "vist elements",
            "if" : "condition statement",
            "del" : "delete element",
            "[]" : "list",
            "{}" : "dic"}
for key, des in coding.items():
    print(key + ": " + des)

print("\ntest4---->")
coding = {
            "for" : "vist elements",
            "if" : "condition statement",
            "del" : "delete element",
            "[]" : "list",
            "{}" : "dic",
            "bool" : "布尔值",
            "true" : "真",
            "false" : "假",
            "set" : "集合"}
for key, des in coding.items():
    print(key + ": " + des)

print("\ntest5---->")
rivers = {
            "nile" : "egypt",
            "yangtze river" : "china",
            "yellow river" : "china",
            "thames river" : "english",
            "mississippi river" : "america"}

for river, nation in rivers.items():
    print("The " +  river.title() + " run through " + nation.title() + ".")

print("\ntest6---->")
interviewees = ["peter", "jason", "xiaohong"]
peoples = {
            "xiaoming" : "c",
            "xiaohong" : "rust",
            "xiaohai" : "python"}

for interviewee in interviewees:
    if interviewee not in peoples.keys():
        print("hi " + interviewee + ", " + \
                "We kindly invite you to participate in our survey !")
    else:
        print("Thank you, " + interviewee)

print("\ntest7---->")
person_0 = { 
            "first_name" : "liu",
            "last_name" : "ming",
            "age" : "25",
            "city" : "suzhou"}

person_1 = { 
            "first_name" : "xiao",
            "last_name" : "hong",
            "age" : "20",
            "city" : "shanghai"}
person_2 = { 
            "first_name" : "xiao",
            "last_name" : "bai",
            "age" : "35",
            "city" : "guizhou"}
peoples = [person_0, person_1, person_2]
for people in peoples:
    print(people)


print("\ntest8---->")
favorite_places = {
                    "xiaohong" : ["guiling", "hangzhou", "chongqing"],
                    "xiaobai" : ["chongqing", "ganshu", "yunnan"],
                    "nannan" : ["shanghai", "nanjing"] }
for name, places in favorite_places.items():
    print("\n" + name + " favorite places:")
    for place in places:
        print(place)
